//
//  WSSearchDeviceView.m
//  FamilyLinkPro
//
//  Created by SiterWell on 2023/10/10.
//  Copyright © 2023 SiterWell.Co.,Ltd. All rights reserved.
//

#import "WSSearchDeviceView.h"

@implementation WSSearchDeviceView

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self setupSubviews];
    }
    return self;
}
// MARK: 添加子控件
- (void)setupSubviews {
//    self.backgroundColor = [UIColor systemPinkColor];
    
    [self addSubview:self.rippleAnimationView];
    [self.rippleAnimationView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self);
        make.width.height.mas_equalTo(40);
        make.top.mas_equalTo(self.mas_top).offset(84);
    }];
    [self.rippleAnimationView startAnimate];
    
    UIImageView *phoneImageView = [[UIImageView alloc] initWithImage:ImageNamed(@"iv_phone")];
    [self addSubview:phoneImageView];
    [phoneImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self);
        make.top.mas_equalTo(self.mas_top).offset(84);
    }];
    
    
    
    
    UILabel *deviceMetionLabel = [[UILabel alloc] initWithFrame:CGRectZero];
    [self addSubview:deviceMetionLabel];
    deviceMetionLabel.text = @"没有搜索到设备，你可以收到添加";
    deviceMetionLabel.textColor = UIColorFromRGB_0x(0xF47B2B);
    deviceMetionLabel.font = font(12);
    [deviceMetionLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(self);
        make.top.mas_equalTo(phoneImageView.mas_bottom).offset(21);
    }];
    
    
}

// MARK: lazy

- (RippleAnimationView *)rippleAnimationView {
    if (!_rippleAnimationView) {
        _rippleAnimationView = [[RippleAnimationView alloc] initWithFrame:CGRectMake(0, 0, 50, 50) animationType:AnimationTypeWithBackground withColor:UIColorFromRGBA_D(76, 128, 248, 0.1) withLoading:YES];
    }
    return _rippleAnimationView;
}






@end
